﻿using PHMEE.ToolKits;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE
{
    /// <summary>
    /// 油船
    /// </summary>
    public class Tanker : Vessel
    {

        protected Tanker()
        {

        }

        public Tanker(Guid id, Guid fleetId, string name, string nameen, string imo)
            : base(id, fleetId, name, nameen, imo)
        {

        }

        /// <summary>
        /// 油容量
        /// </summary>
        [NotMapped]
        public double TankerCapacity { get; set; }

        /// <summary>
        /// 油类别
        /// </summary>
        [NotMapped]
        public string TankerType { get; set; }

        /// <summary>
        /// 泵系统类型
        /// </summary>
        [NotMapped]
        public string PumpingSystem { get; set; }

        /// <summary>
        /// 油仓数量
        /// </summary>
        [NotMapped]
        public int NumberOfTanks { get; set; }

        /// <summary>
        /// 管道数量
        /// </summary>
        [NotMapped]
        public int PipelineCount { get; set; }

        public override void SerializeProperties(Dictionary<string, object> derivedPropertiesJson)
        {
            var properties = PHMEECoreHelper.GetDerivedProperties(this);
            this.DerivedPropertiesJson = derivedPropertiesJson.Where(item => properties.Keys.Any(p => string.Equals(p, item.Key, StringComparison.OrdinalIgnoreCase))).ToDictionary();
        }

        public override void DeserializeProperties()
        {
            PHMEECoreHelper.SetDerivedProperties(this, DerivedPropertiesJson);
        }

    }
}
